
import Vue from 'vue'
import VueRouter from 'vue-router'
import App from './components/app.vue'
import headerVue from './components/header.vue'
import bodyVue from './components/body.vue'
import detailVue from './components/detail.vue'
import footerVue from './components/footer.vue'
import cartVue from './components/cart.vue'
import Axios from 'axios'

Vue.use(VueRouter)
Axios.defaults.baseURL = 'http://127.0.0.1:3002'
Vue.prototype.$axios = Axios
// Axios.defautls.baseURL='http://127.0.0.1:3002'
// Vue.prototype.$axios= Axios

const componentStudentProfile={
    template: `<div style='background-color:yellow'>简介:<br/>
               姓名: XXX<br/>
               <div>
    `
}
const componentStudentScores={
    template: `<div style='background-color:red'>成绩:<br/>
               Javascript框架开发：500分<br/>
               <div>
    `
}
let router = new VueRouter({
    mode:'history',
    routes:[
        {name:'/',path:'/',component:bodyVue},
        {name:'detail',path:'/detail',component:detailVue},
        {name:'cart',path:'/cart',component:cartVue}
    ]
})
Vue.component('headerVue',headerVue)
Vue.component('footerVue',footerVue)
Vue.component('cartVue',cartVue)
new Vue({
    el:'#el',
    router,
    render: c=>c(App)
})